package com.slipper.groovy.util;

import com.slipper.PaasContext;
import com.slipper.system.message.bo.MessageBO;
import com.slipper.system.message.service.MessageService;

public class MessageUtil {
    public static int send(String type, String title, String content) {
        return send(type, null, null, null , title, content);
    }

    public static int send(
            String type,
            String systemIds,
            String receiveType,
            String receiverIds,
            String title,
            String content) {
        MessageBO bo = new MessageBO();
        bo.setType(type);
        bo.setSystemIds(systemIds);
        bo.setReceiveType(receiveType);
        bo.setReceiverIds(receiverIds);
        bo.setTitle(title);
        bo.setContent(content);
        return PaasContext.getBean(MessageService.class).save(bo);
    }
}
